package com.sws.common.utils.access_tokenutil.service.impl;


import com.sws.common.utils.access_tokenutil.model.DeviceToken;
import com.sws.common.utils.access_tokenutil.service.IAccessTokenService;
import com.sws.common.utils.access_tokenutil.util.AccessTokenUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 访问令牌服务实现类
 * 
 * @author sws
 */
@Slf4j
@Service
public class AccessTokenServiceImpl implements IAccessTokenService {

    @Override
    public DeviceToken getAccessToken(String deviceIp) {
        return AccessTokenUtil.getAccessToken(deviceIp);
    }

    @Override
    public boolean refreshAccessToken(String deviceIp) {
        return AccessTokenUtil.refreshAccessToken(deviceIp);
    }

    @Override
    public void refreshAllAccessTokens() {
        AccessTokenUtil.refreshAllAccessTokens();
    }

    @Override
    public String getToken(String deviceIp) {
        return AccessTokenUtil.getToken(deviceIp);
    }
} 